package com.demo.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.demo.core.domain.Result;
import com.demo.domain.Comment;
import com.demo.core.exception.ParameterException;
import com.demo.domain.ro.SaveCmtRequest;
import com.demo.domain.vo.CommentView;
import org.springframework.transaction.annotation.Transactional;

import java.io.IOException;

@Transactional
public interface CommentService extends IService<Comment> {

    Result getPostCommentsWithReplies(Long postId, int currentPage,Long uid) throws ParameterException;

//    IPage<CommentView> getCommentViewPage(int currentPage, int pageSize, Comment comment)throws ParameterException;

    /**
     * 根据对应评论表id
     * @param currentPage
     * @param pageSize
     * @param comment
     * @return
     */
    IPage<Comment> getCommentByCpId(int currentPage, int pageSize,Comment comment)throws ParameterException;

    Result saveComment(SaveCmtRequest saveCmtRequest,Long uid) throws IOException, ParameterException;

    /**
     * 发布评论
     * @param comment
     * @return
     */
    boolean saveCommentFlag(Comment comment)throws ParameterException;
}
